package Controller.AreaGender;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.joinHadoopBean;
import Dao.AreaGenderDao;

public class WoolsanGenderChartContoller implements Controller{
	private AreaGenderDao dao;
	public void setDao(AreaGenderDao dao) {
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		System.out.println("울산 성별 장르 선호도 컨트롤러 ");
		
		int ka_no = dao.woolsanSequence();
		System.out.println("울산 시퀀스 값 : " + ka_no);
		
		List<joinHadoopBean> woolsangender = dao.woolsangender(ka_no);
		for (joinHadoopBean joinHadoopBean : woolsangender) {
			System.out.println("카운터 : "+joinHadoopBean.getAreagglbean().getAggl_count());
			System.out.println("성별 남자 1 여자 2 : "+joinHadoopBean.getAreagglbean().getAggl_gender());
			System.out.println("장르 : "+joinHadoopBean.getGenrebean().getG_genre());
		}
		ModelAndView mav = new ModelAndView();
		mav.setViewName("woolsanGender");
		mav.addObject("woolsangender", woolsangender);
		return mav;
	}
}
